/*
 * @Author: zhoulei0232
 * @Date: 2022-12-09 12:05:43
 * @LastEditTime: 2023-03-24 00:02:49
 * @LastEditors: zhoulei0232
 * @Description:
 */
import request from "@/utils/request";

// 查询列表
export function listUser(query) {
  return request({
    url: "/api/user/list",
    method: "get",
    params: query,
  });
}

// 编辑
export function updateUser(data) {
  return request({
    url: "/api/user/update",
    method: "post",
    data: data,
  });
}

// 查询
export function getUser(id) {
  return request({
    url: "/api/user/detail/" + id,
    method: "get",
  });
}

// 新增
export function addUser(data) {
  return request({
    url: "/api/user/add",
    method: "post",
    data: data,
  });
}

// 查询用户所有昵称
export function getPlatformUserlistAll(id) {
  return request({
    url: "/api/platformUser/listAll/" + id,
    method: "get",
  });
}

// 修改用户所有昵称
export function updatePlatformUser(data) {
  return request({
    url: "/api/platformUser/update",
    method: "post",
    data: data,
  });
}

// 用户密码重置
export function updateUserPwd(oldPassword, newPassword) {
  const data = {
    oldPassword,
    newPassword,
  };
  return request({
    url: "/api/user/updatePwd",
    method: "post",
    data: data,
  });
}
